Introducing CSS3
- CSS treats each HTML e XX lement as if it appears inside its own box and uses rules to indicate how that element should look.
- XX Rules are made up of selectors (that specify the elements the rule applies to) and declarations (that indicate what these elements should look like).
- XX Different types of selectors allow you to target your rules at different elements.
- XX Declarations are made up of two parts: the properties of the element that you want to change, and the values of those properties.
- For example, the font-family property sets the choice of font, and the value arial specifies Arial as the preferred typeface.
- XX CSS rules usually appear in a separate document, although they may appear within an HTML page.
Colors in CSS3
- Color not only brings your s XX ite to life, but also helps convey the mood and evokes reactions.
- XX There are three ways to specify colors in CSS: RGB values, hex codes, and color names.
- XX Color pickers can help you find the color you want.
- XX It is important to ensure that there is enough contrast between any text and the background color (otherwise
people will not be able to read your content).
- XX CSS3 has introduced an extra value for RGB colors to indicate opacity. It is known as RGBA.
- XX CSS3 also allows you to specify colors as HSL values, with an optional opacity value. It is known as HSLA.